// ********************************************************************************************
// Este archivo fuente es propiedad de Feria de Remates S.R.L. de C.V. Prohibida su copia o uso
// sin autorización explícita.
// This source file is propietary to Feria de Remates S.R.L. de C.V. May not be used or copied
// without explicit authorization.
// ********************************************************************************************/
package com.feriaderemates.domain.userAccount;

import java.sql.Timestamp;
import java.util.Date;

/**
 *
 * @author Oscar García
 */
public class UserFeedback {

    private final int userFeedbackId;
    private final String message;
    private final long listingId;
    private final String listingTitle;
    private final Timestamp date;
    private final String senderUsername;
    private final String receiverUsername;
    private final UserFeedbackLevel feedbackLevel;

    private UserFeedback(int userFeedbackId, String message, long listingId, Timestamp date, String listingTitle,
            String receiverUsername, String senderUsername, UserFeedbackLevel feedbackLevel) {
        this.userFeedbackId = userFeedbackId;
        this.message = message;
        this.listingId = listingId;
        this.date = date;
        this.listingTitle = listingTitle;
        this.senderUsername = senderUsername;
        this.receiverUsername = receiverUsername;
        this.feedbackLevel = feedbackLevel;
    }

    private UserFeedback(String message, long listingId, String receiverUsername, String senderUsername, UserFeedbackLevel feedbackLevel) {
        this.userFeedbackId = -1;
        this.message = message;
        this.listingId = listingId;
        this.date = null;
        this.listingTitle = null;
        this.senderUsername = senderUsername;
        this.receiverUsername = receiverUsername;
        this.feedbackLevel = feedbackLevel;
    }

    public static UserFeedback createUserFeedbackToInsert(String message, long listingId, String receiverUsername, String senderUsername, UserFeedbackLevel feedbackLevel) {
        return new UserFeedback(message, listingId, receiverUsername, senderUsername, feedbackLevel);
    }

    public static UserFeedback createUserFeedbackToShow(int userFeedbackId, String message, long listingId, Timestamp date,
            String listingTitle, String receiverUsername, String senderUsername, UserFeedbackLevel feedbackLevel) {
        return new UserFeedback(userFeedbackId, message, listingId, date, listingTitle, receiverUsername, senderUsername, feedbackLevel);
    }

    /**
     * @return the userFeedbackId
     */
    public int getUserFeedbackId() {
        return userFeedbackId;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * @return the listingId
     */
    public long getListingId() {
        return listingId;
    }

    /**
     * @return the listingTitle
     */
    public String getListingTitle() {
        return listingTitle;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @return the senderUsername
     */
    public String getSenderUsername() {
        return senderUsername;
    }

    /**
     * @return the receiverUsername
     */
    public String getReceiverUsername() {
        return receiverUsername;
    }

    /**
     * @return the feedbackLevel
     */
    public UserFeedbackLevel getFeedbackLevel() {
        return feedbackLevel;
    }
}
